home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11958 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: rain.fr!world-net!usenet
  2. From: Frederic LACHASSE <lachass@worldnet.fr>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: C++ newbie asks for help
  5. Date: Sun, 17 Mar 1996 07:35:16 +0000
  6. Organization: World-Net information exchange, Internet provider.
  7. Message-ID: <VA.0000006d.00028cda@fred>
  8. References: <31488AC8.1557@cco.caltech.edu>
  9. Reply-To: lachass@worldnet.fr
  10. NNTP-Posting-Host: client122.sct.fr
  11. X-Newsreader: Virtual Access by Ashmount Research Ltd, http://www.ashmount.com
  12.  
  13. For performance reason, iostreams are generally buffered, that is output 
  14. to cout are temporarily stored in a buffer and is sent to the screen 
  15. only when the buffer is full or the stream is flushed.
  16.  
  17. To flush an ostream you can use its flush() member function:
  18.  
  19.   cout.flush();
  20.  
  21. or use the "flush" manipulator:
  22.  
  23.   cout << flush;
  24.  
  25. Another very useful manipulator is "endl" that inserts a new line 
  26. character then flushes the ostream:
  27.  
  28.  cout << endl; // finish the line and print it.
  29.  
  30. I hope this'll help.
  31.  
  32.  Frederic LACHASSE (ECP 86)
  33.  CompuServe: 100530,2005
  34.  Internet: lachass@worldnet.fr
  35.  
  36.